﻿Create  proc [dbo].[danhmucTaiKhoan_Sua]
@ma_tk varchar(50),
@loai_tk nvarchar(255),
@ten_tk nvarchar(255),
@input bit,
@congno bit,
@cap nvarchar(50),
@capduoi bit,
@captren nvarchar(50)

as
if exists(select * from DM_taikhoan   Where [ma_tk] <>@ma_tk  and loai_tk =@loai_tk   )
begin
select ErrCode=0
end
else
begin
update DM_taikhoan    set loai_tk=@loai_tk,ten_tk=@ten_tk,input=@input,
  congno=@congno,cap=@cap,capduoi=@capduoi,captren=@captren

 WHere [ma_tk] =@ma_tk  
 
select ErrCode=1
end